www.gusucode.com > 种植养殖类网站源码 农场网站模板通用版模板(demo6) > 种植养殖类网站源码 农场网站模板通用版模板(demo6)/style/js/imgMove.js

    function an(g){function h(){var a=document.getElementById("s").getContext("2d");new Chart(a).Doughnut(j,i),$("#con1_list li a").text(g).parent().fadeIn(200)}var f=360*parseInt(g)/100,j=[{value:f,color:"#009a6d"},{value:360-f,color:"#ffffff"}],i={percentageInnerCutout:80,segmentShowStroke:!1};setTimeout(h,300)}!function(e,d){e.HoverDir=function(a,g){this.$el=e(g),this._init(a)},e.HoverDir.defaults={speed:300,easing:"ease",hoverDelay:0,inverse:!1},e.HoverDir.prototype={_init:function(a){this.options=e.extend(!0,{},e.HoverDir.defaults,a),this.transitionProp="all "+this.options.speed+"ms "+this.options.easing,this.support=Modernizr.csstransitions,this._loadEvents()},_loadEvents:function(){var a=this;this.$el.on("mouseenter.hoverdir, mouseleave.hoverdir",function(k){var j=e(this),i=j.find("div"),h=a._getDir(j,{x:k.pageX,y:k.pageY}),b=a._getStyle(h);"mouseenter"===k.type?(i.hide().css(b.from),clearTimeout(a.tmhover),a.tmhover=setTimeout(function(){i.show(0,function(){var g=e(this);a.support&&g.css("transition",a.transitionProp),a._applyAnimation(g,b.to,a.options.speed)})},a.options.hoverDelay)):(a.support&&i.css("transition",a.transitionProp),clearTimeout(a.tmhover),a._applyAnimation(i,b.from,a.options.speed))})},_getDir:function(i,h){var n=i.width(),m=i.height(),l=(h.x-i.offset().left-n/2)*(n>m?m/n:1),k=(h.y-i.offset().top-m/2)*(m>n?n/m:1),j=Math.round((Math.atan2(k,l)*(180/Math.PI)+180)/90+3)%4;return j},_getStyle:function(r){var q,p,o={left:"0px",top:"-100%"},n={left:"0px",top:"100%"},m={left:"-100%",top:"0px"},l={left:"100%",top:"0px"},k={top:"0px"},j={left:"0px"};switch(r){case 0:q=this.options.inverse?n:o,p=k;break;case 1:q=this.options.inverse?m:l,p=j;break;case 2:q=this.options.inverse?o:n,p=k;break;case 3:q=this.options.inverse?l:m,p=j}return{from:q,to:p}},_applyAnimation:function(a,h,g){e.fn.applyStyle=this.support?e.fn.css:e.fn.animate,a.stop().applyStyle(h,e.extend(!0,[],{duration:g+"ms"}))}};var f=function(b){d.console&&d.console.error(b)};e.fn.hoverdir=function(a){var g,c=e.data(this,"hoverdir");return"string"==typeof a?(g=Array.prototype.slice.call(arguments,1),this.each(function(){return c?e.isFunction(c[a])&&"_"!==a.charAt(0)?(c[a].apply(c,g),void 0):(f("no such method '"+a+"' for hoverdir instance"),void 0):(f("cannot call methods on hoverdir prior to initialization; attempted to call method '"+a+"'"),void 0)})):this.each(function(){c?c._init():c=e.data(this,"hoverdir",new e.HoverDir(a,this))}),c}}(jQuery,window),window.Modernizr=function(ab,aa,Z){function Y(b){K.cssText=b}function X(d,c){return typeof d===c}function W(d,c){return !!~(""+d).indexOf(c)}function V(f,c){var h,g;for(h in f){if(g=f[h],!W(g,"-")&&K[g]!==Z){return"pfx"==c?g:!0}}return !1}function U(f,c,j){var i,h;for(i in f){if(h=c[f[i]],h!==Z){return j===!1?f[i]:X(h,"function")?h.bind(j||c):h}}return !1}function T(g,f,j){var i=g.charAt(0).toUpperCase()+g.slice(1),h=(g+" "+y.join(i+" ")+i).split(" ");return X(f,"string")||X(f,"undefined")?V(h,f):(h=(g+" "+x.join(i+" ")+i).split(" "),U(h,f,j))}var J,L,H,G,S="2.6.2",R={},Q=!0,P=aa.documentElement,O="modernizr",N=aa.createElement(O),K=N.style,F=({}.toString,"Webkit Moz O ms"),y=F.split(" "),x=F.toLowerCase().split(" "),s={},e=[],M=e.slice,I={}.hasOwnProperty;H=X(I,"undefined")||X(I.call,"undefined")?function(d,c){return c in d&&X(d.constructor.prototype[c],"undefined")}:function(d,c){return I.call(d,c)},Function.prototype.bind||(Function.prototype.bind=function(g){var i,h,f=this;if("function"!=typeof f){throw new TypeError}return i=M.call(arguments,1),h=function(){var c,b,a;return this instanceof h?(c=function(){},c.prototype=f.prototype,b=new c,a=f.apply(b,i.concat(M.call(arguments))),Object(a)===a?a:b):f.apply(g,i.concat(M.call(arguments)))}}),s.csstransitions=function(){return T("transition")};for(G in s){H(s,G)&&(L=G.toLowerCase(),R[L]=s[G](),e.push((R[L]?"":"no-")+L))}return R.addTest=function(f,c){if("object"==typeof f){for(var g in f){H(f,g)&&R.addTest(g,f[g])}}else{if(f=f.toLowerCase(),R[f]!==Z){return R}c="function"==typeof c?c():c,"undefined"!=typeof Q&&Q&&(P.className+=" "+(c?"":"no-")+f),R[f]=c}return R},Y(""),N=J=null,function(r,q){function p(g,f){var i=g.createElement("p"),h=g.getElementsByTagName("head")[0]||g.documentElement;return i.innerHTML="x<style>"+f+"</style>",h.insertBefore(i.lastChild,h.firstChild)}function o(){var b=J.elements;return"string"==typeof b?b.split(" "):b}function n(d){var c=N[d[P]];return c||(c={},O++,d[P]=O,N[O]=c),c}function m(b,i,h){if(i||(i=q),K){return i.createElement(b)}h||(h=n(i));var g;return g=h.cache[b]?h.cache[b].cloneNode():R.test(b)?(h.cache[b]=h.createElem(b)).cloneNode():h.createElem(b),g.canHaveChildren&&!S.test(b)?h.frag.appendChild(g):g}function l(b,w){if(b||(b=q),K){return b.createDocumentFragment()}w=w||n(b);for(var v=w.frag.cloneNode(),u=0,t=o(),d=t.length;d>u;u++){v.createElement(t[u])}return v}function k(d,c){c.cache||(c.cache={},c.createElem=d.createElement,c.createFrag=d.createDocumentFragment,c.frag=c.createFrag()),d.createElement=function(a){return J.shivMethods?m(a,d,c):c.createElem(a)},d.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+o().join().replace(/\w+/g,function(b){return c.createElem(b),c.frag.createElement(b),'c("'+b+'")'})+");return n}")(J,c.frag)}function j(b){b||(b=q);var c=n(b);return J.shivCSS&&!Q&&!c.hasCSS&&(c.hasCSS=!!p(b,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),K||k(b,c),b}N={};!function(){}(),J={},r.html5=J,j(q)}(this,aa),R._version=S,R._domPrefixes=x,R._cssomPrefixes=y,R.testProp=function(b){return V([b])},R.testAllProps=T,P.className=P.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(Q?" js "+e.join(" "):""),R}(this,this.document),function(ad,ac,ab){function aa(b){return"[object Function]"==P.call(b)}function Z(b){return"string"==typeof b}function Y(){}function X(b){return !b||"loaded"==b||"complete"==b||"uninitialized"==b}function W(){var b=N.shift();L=1,b?b.t?R(function(){("c"==b.t?M.injectCss:M.injectJs)(b.s,0,b.a,b.x,b.e,1)},0):(b(),W()):L=0}function V(w,v,t,s,q,p,n){function m(a){if(!g&&X(h.readyState)&&(x.r=g=1,!L&&W(),h.onload=h.onreadystatechange=null,a)){"img"!=w&&R(function(){I.removeChild(h)},50);for(var c in D[v]){D[v].hasOwnProperty(c)&&D[v][c].onload()}}}var n=n||M.errorTimeout,h=ac.createElement(w),g=0,b=0,x={t:t,s:v,e:q,a:p,x:n};1===D[v]&&(b=1,D[v]=[]),"object"==w?h.data=v:(h.src=v,h.type=w),h.width=h.height="0",h.onerror=h.onload=h.onreadystatechange=function(){m.call(this,b)},N.splice(s,0,x),"img"!=w&&(b||2===D[v]?(I.insertBefore(h,J?null:Q),R(m,n)):D[v].push(h))}function U(g,e,j,i,h){return L=0,e=e||"j",Z(g)?V("c"==e?G:H,g,e,this.i++,j,i,h):(N.splice(this.i++,0,g),1==N.length&&W()),this}function T(){var b=M;return b.loader={load:U,i:0},b}var O,M,S=ac.documentElement,R=ad.setTimeout,Q=ac.getElementsByTagName("script")[0],P={}.toString,N=[],L=0,K="MozAppearance" in S.style,J=K&&!!ac.createRange().compareNode,I=J?S:Q.parentNode,S=ad.opera&&"[object Opera]"==P.call(ad.opera),S=!!ac.attachEvent&&!S,H=K?"object":S?"script":"img",G=S?"script":H,F=Array.isArray||function(b){return"[object Array]"==P.call(b)},E=[],D={},C={timeout:function(d,c){return c.length&&(d.timeout=c[0]),d}};M=function(e){function c(i){var o,l,j,i=i.split("!"),h=E.length,q=i.pop(),p=i.length,q={url:q,origUrl:q,prefixes:i};for(l=0;p>l;l++){j=i[l].split("="),(o=C[j.shift()])&&(q=o(q,j))}for(l=0;h>l;l++){q=E[l](q)}return q}function n(b,s,r,q,p){var o=c(b),l=o.autoCallback;o.url.split(".").pop().split("?").shift(),o.bypass||(s&&(s=aa(s)?s:s[b]||s[q]||s[b.split("/").pop().split("?")[0]]),o.instead?o.instead(b,s,r,q,p):(D[o.url]?o.noexec=!0:D[o.url]=1,r.load(o.url,o.forceCSS||!o.forceJS&&"css"==o.url.split(".").pop().split("?").shift()?"c":ab,o.noexec,o.attrs,o.timeout),(aa(s)||aa(l))&&r.load(function(){T(),s&&s(o.origUrl,p,q),l&&l(o.origUrl,p,q),D[o.url]=2})))}function m(w,v){function u(b,h){if(b){if(Z(b)){h||(r=function(){var i=[].slice.call(arguments);q.apply(this,i),p()}),n(b,r,v,0,t)}else{if(Object(b)===b){for(g in o=function(){var i,a=0;for(i in b){b.hasOwnProperty(i)&&a++}return a}(),b){b.hasOwnProperty(g)&&(!h&&!--o&&(aa(r)?r=function(){var i=[].slice.call(arguments);q.apply(this,i),p()}:r[g]=function(i){return function(){var a=[].slice.call(arguments);i&&i.apply(this,a),p()}}(q[g])),n(b[g],r,v,g,t))}}}}else{!h&&p()}}var o,g,t=!!w.test,s=w.load||w.both,r=w.callback||Y,q=r,p=w.complete||Y;u(t?w.yep:w.nope,!!s),s&&u(s)}var k,f,d=this.yepnope.loader;if(Z(e)){n(e,0,d,0)}else{if(F(e)){for(k=0;k<e.length;k++){f=e[k],Z(f)?n(f,0,d,0):F(f)?M(f):Object(f)===f&&m(f,d)}}else{Object(e)===e&&m(e,d)}}},M.addPrefix=function(d,c){C[d]=c},M.addFilter=function(b){E.push(b)},M.errorTimeout=10000,null==ac.readyState&&ac.addEventListener&&(ac.readyState="loading",ac.addEventListener("DOMContentLoaded",O=function(){ac.removeEventListener("DOMContentLoaded",O,0),ac.readyState="complete"},0)),ad.yepnope=T(),ad.yepnope.executeStack=W,ad.yepnope.injectJs=function(r,q,p,n,m,h){var f,b,g=ac.createElement("script"),n=n||M.errorTimeout;g.src=r;for(b in p){g.setAttribute(b,p[b])}q=h?W:q||Y,g.onreadystatechange=g.onload=function(){!f&&X(g.readyState)&&(f=1,q(),g.onload=g.onreadystatechange=null)},R(function(){f||(f=1,q(1))},n),m?g.onload():Q.parentNode.insertBefore(g,Q)},ad.yepnope.injectCss=function(b,n,m,l,k,h){var f,l=ac.createElement("link"),n=h?W:n||Y;l.href=b,l.rel="stylesheet",l.type="text/css";for(f in m){l.setAttribute(f,m[f])}k||(Q.parentNode.insertBefore(l,Q),R(n,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},$(function(){function g(){return window.innerHeight?h=window.innerHeight:document.body&&document.body.clientHeight&&(h=document.body.clientHeight),document.documentElement&&document.documentElement.clientHeight&&(h=document.documentElement.clientHeight),h}var b,h,f;$(" #con1_list > li ").each(function(){$(this).hoverdir()})});